<?php
/* @var $this ProveedoresController */
/* @var $model Proveedores */
/* @var $form CActiveForm */
?>
<script type="text/javascript">
$(document).ready(function(){
	$("#Proveedores_TELEFONO").keypress(function(event){
		var keynum = window.event ? window.event.keyCode : e.which;
    	if ((keynum == 8) || (keynum == 0))
    		return true;
   		return /\d/.test(String.fromCharCode(keynum));
   		});
});

$(document).ready(function(){
	$("#Proveedores_IDProveedor").keypress(function(event){
		var keynum = window.event ? window.event.keyCode : e.which;
    	if ((keynum == 8) || (keynum == 0))
    		return true;
   		return /\d/.test(String.fromCharCode(keynum));
   		});
});

$(document).ready(function(){
	$("#Proveedores_Extension").keypress(function(event){
		var keynum = window.event ? window.event.keyCode : e.which;
    	if ((keynum == 8) || (keynum == 0))
    		return true;
   		return /\d/.test(String.fromCharCode(keynum));
   		});
});
</script>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'proveedores-form',
	'enableAjaxValidation'=>false,
	'enableClientValidation'=>false,
	'clientOptions'=>array(
		'validateOnSubmit'=>true)
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'IDProveedor'); ?>
		<?php echo $form->dropDownList($model, 'TIPO',
    	array('F' => 'Cédula Física', 'J' => 'Cédula Juridica', 'P' => 'Pasaporte')); ?>
		<?php echo $form->error($model,'TIPO'); ?>
		<?php echo $form->textField($model,'IDProveedor',array('size'=>20,'maxlength'=>20, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'IDProveedor'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'NOMBRE'); ?>
		<?php echo $form->textField($model,'NOMBRE',array('size'=>20,'maxlength'=>20, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'NOMBRE'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Descripcion'); ?>
		<?php echo $form->textArea($model,'Descripcion',array('size'=>20,'maxlength'=>100, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'Descripcion'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'EMAIL'); ?>
		<?php echo $form->textField($model,'EMAIL',array('size'=>20,'maxlength'=>20, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'EMAIL'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'DIRECCION'); ?>
		<?php echo $form->textArea($model,'DIRECCION',array('size'=>20,'maxlength'=>100, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'DIRECCION'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'TELEFONO'); ?>
		<?php echo $form->textField($model,'TELEFONO',array('size'=>20,'maxlength'=>11, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'TELEFONO'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Extension'); ?>
		<?php echo $form->textField($model,'Extension',array('size'=>20,'maxlength'=>5)); ?>
		<?php echo $form->error($model,'Extension'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Contacto'); ?>
		<?php echo $form->textField($model,'Contacto',array('size'=>20,'maxlength'=>40)); ?>
		<?php echo $form->error($model,'Contacto'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'ESTADO'); ?>
		<?php echo $form->dropDownList($model, 'ESTADO',
    	array('1' => 'Activo', '0' => 'Inactivo'),
    	array('empty' => 'Seleccione un estado')); ?>
		<?php echo $form->error($model,'ESTADO'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Actualizar' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->